<?php

namespace Search\Form;

use Zend\Form\Form;

class SearchForm extends Form {
    public function __construct($name = null)
    {
        parent::__construct('search');
        $this->setAttribute('method', 'post');
        $this->setAttribute('class', 'form-inline pull-right');
        $this->setInputFilter(new SearchFormFilter());
    
        $this->add(array(
            'name' => 'KEY',            
            'options' => array(
               'label' => ''
            ),
            'type' => 'Text',
            'attributes' => array(
                'class' => 'form-control',
                'id' => 'searchKEY'
            )
        ));
        
        $this->add(array(
            'name' => 'CATEGORY',
            'options' => array(
                'label' => '',
               // 'empty_option' => '--select a search category--',
               // 'disable_inarray_validator' => true
            ),
            'type' => 'Select',
            'attributes' => array(
                'class' => 'form-control',
                'id' => 'searchCATEGORY'
            )
        ));
        
        $this->add(array(
            'name' => 'BTNSEARCH',
            'id' => 'searchbutton',
            'type' => 'submit',
            'options' => array(
                'label' => ''
            ),
            'attributes' => array(
                'value' => 'Search',
                'class' => 'btn btn-info'
            )
        ));
    }
}